I am test page <br/>
{$data.ahoj}<br/>

<input type="text" id="name"/>
<input type="number" id="number"/>

<input type="button" value="Test Ajax" onclick="TestAjax();"/>

<br/>
{foreach item="t" from=$data.t}
	{$t->name} = {$t->number}
	<br/>
{/foreach}

{literal}
<script type="text/javascript">
	function TestAjax(){
		$.ajax({ 
			data: {
				action : 'test',
				controller : 'test',
				name : $("#name").val(),
				number : $("#number").val(),
			},
			success: function(data){
				window.location.reload(true);
				console.log(data);
			},
			error: function(data){
				console.log("error");
			}
		})
	}
	
</script>
{/literal}